package cn.wolfcode.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author dou
 * @since 2023-04-13
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class News extends Model<News> {

    private static final long serialVersionUID=1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String title;

    private String author;

    private LocalDateTime createTime;

    private Long viewnum;

    /**
     * 摘要
     */
    private String summary;
    /**
     * @TableField 注解用于i在数据库的列名和实体类的属性名不同时，做映射
     * 当数据库中没有这个列对应该属性时，直接使用exist=false表示没有数据
     */
    @TableField(exist = false)
    private NewContent Content;

}
